<template>
  <div class="app-container">
    <el-form :model="searchFormTwo" :inline="true" v-if="tabShow === 1">
      <el-row>
        <el-col :span="20">
          <el-form-item label="样品编号:">
            <el-input v-model="searchFormTwo.sampleNo" style="width:200px" clearable placeholder="样品编号" />
          </el-form-item>
          <el-form-item>
            <el-button type="primary" class="iconfont icon-chaxun1" @click="handleSearchTwo"> 查询</el-button>
          </el-form-item>
          <div style="float: right;margin-top: 4px;">
            <el-button type="primary" class="views" @click="tabChange()" style="margin-right: -10px;border-radius:0">样品列表</el-button>
            <el-button type="primary" class="viewsb" @click="tabChangeTwo()" style="border-radius:0">因子列表</el-button>
          </div>
        </el-col>
        <el-col :span="4" class="search-right">
          <el-button type="text" icon="el-icon-refresh" @click="handleSearchTwo">刷新</el-button>
        </el-col>
      </el-row>
    </el-form>
    <el-table
      v-if="tabShow === 1"
      :data="checkDataTwo"
      stripe
      border
      highlight-current-row
      :header-cell-style="{background:'#ECF3FC'}"
      style="width: 100%"
      @selection-change="handleSelectionChangeTwo"
    >
      <el-table-column type="index" width="50" align="center" label="序号" />
      <el-table-column prop="sampleNo" label="样品编号" width="150px" align="center" />
      <el-table-column prop="secdClassName" label="检测类别" width="130" align="center" />
      <el-table-column prop="factorPoint" label="采样点位" width="120px" align="center" />
      <el-table-column prop="factorNameTwo" label="检测因子" width="180" align="center">
        <template slot-scope="row">
          <el-tooltip effect="dark" placement="top">
            <div slot="content" style="max-width: 400px">{{ row.row.factorNameTwo}}</div>
            <div class="apostrophe">
              <span>{{ row.row.factorNameTwo}}</span>
            </div>
          </el-tooltip>
        </template>
      </el-table-column>
      <el-table-column prop="dayAndCount" label="频次(次/天)" width="120px" align="center" />
      <el-table-column prop="cyDate" label="采样时间" min-width="160px" align="center">
        <template slot-scope="{row}">
          {{ row.collectDate}}&nbsp;{{ row.collectTime}}
        </template>
      </el-table-column>
      <el-table-column prop="storeTime" label="入库时间" min-width="160px" align="center" />
      <el-table-column prop="storeAppTime" label="出库时间" min-width="160px" align="center" />
      <el-table-column prop="sampCount" label="待审核因子数" width="140px" align="center">
        <template slot-scope="{row}">
          {{ row.sampCount}}
        </template>
      </el-table-column>
      <el-table-column prop="dataEntryStep" label="样品归类" width="120px" align="center">
        <template slot-scope="{row}">
          <el-tag :type="row.sampleType ==='1'?'danger':''">
            {{ row.sampleType ==='1'?"样品分包":"样品自检" }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="140px" fixed="right" align="center">
        <template slot-scope="{row}">
          <el-button type="text" @click="factorAudit(row)">因子审核</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div style="float: right" v-if="tabShow === 1">
      <pagination
        v-show="totalTwo>0"
        :total="totalTwo"
        :page.sync="searchFormTwo.pageNumber"
        :limit.sync="searchFormTwo.pageSize"
        @pagination="handleSearchTwo"
      />
    </div>

    <el-form :model="searchForm" :inline="true" v-if="tabShow === 2">
      <el-row>
        <el-col :span="20">
          <el-form-item label="样品编号:">
            <el-input v-model="searchForm.sampleNo" style="width:200px" clearable placeholder="样品编号" />
          </el-form-item>
          <el-form-item label="检测因子:">
            <el-input v-model="searchForm.factorName" style="width:200px" clearable placeholder="检测因子" />
          </el-form-item>
          <el-form-item>
            <el-button type="primary" class="iconfont icon-chaxun1" @click="handleSearch"> 查询</el-button>
            <el-button type="primary" @click="handleBatchApprove"> 批量审核</el-button>
          </el-form-item>
          <div style="float: right;margin-top: 4px;">
            <el-button type="primary" class="views" @click="tabChange()" style="margin-right: -10px;border-radius:0">样品列表</el-button>
            <el-button type="primary" class="viewsb" @click="tabChangeTwo()" style="border-radius:0">因子列表</el-button>
          </div>
        </el-col>
        <el-col :span="4" class="search-right">
          <el-button type="text" icon="el-icon-refresh" @click="handleSearch">刷新</el-button>
        </el-col>
      </el-row>
    </el-form>

    <el-table
      v-if="tabShow === 2"
      :data="checkData"
      stripe
      border
      highlight-current-row
      :header-cell-style="{background:'#ECF3FC'}"
      style="width: 100%"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="50" :key="Math.random()" align="center" />
      <el-table-column type="index" width="50" :key="Math.random()" align="center" label="序号" />
      <el-table-column prop="sampleNo" label="样品编号" width="160px" :key="Math.random()" align="center" />
      <el-table-column prop="factorName" label="检测因子" min-width="200px" :key="Math.random()" align="center" />
      <el-table-column prop="secdClassName" label="检测类别" width="130" :key="Math.random()" align="center" />
      <el-table-column prop="factorPoint" label="检测位置" width="130px" :key="Math.random()" align="center">
        <template slot-scope="{row}">
          {{ row.factorPoint}}
        </template>
      </el-table-column>
      <el-table-column prop="dayAndCount" label="频次(次/天)" width="120px" :key="Math.random()" align="center">
        <template slot-scope="{row}">
          {{ row.dayAndCount}}
        </template>
      </el-table-column>
      <el-table-column prop="standardNo" label="标准号" min-width="200px" :key="Math.random()" align="center" />
      <el-table-column prop="standardName" label="标准名称" min-width="200px" :key="Math.random()" align="center" />
      <el-table-column prop="checkRes" label="检测结果" min-width="160px" :key="Math.random()" align="center">
        <template slot-scope="{row}">
          <template v-if="row.checkRes && row.checkRes.length >0">
            {{ row.masterRes }}
            <template v-if="row.exponRes!==''&&row.exponRes!==0">×10<sup>{{ row.exponRes }}</sup></template>
            {{ row.unitName && row.unitName!=='无量纲'?' ' + row.unitName:'' }}
          </template>
          <template v-else />
        </template>
      </el-table-column>
      <el-table-column prop="checkStatus" label="状态" width="120px" :key="Math.random()" align="center">
        <template slot-scope="{row}">
          <el-tag :type="row.checkStatus|statusQualityFilter">
            {{ CHECK_STATUS[row.checkStatus] }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column prop="assignUser" label="分析员" :key="Math.random()" align="center">
        <template slot-scope="{row}">
          {{ row.assignUser}}
        </template>
      </el-table-column>
      <el-table-column prop="collectTime" label="采样时间" width="160" :key="Math.random()" align="center">
        <template slot-scope="{row}">
          <template v-if="row.collectTime || row.collectDate">
            {{ row.collectTime && row.collectTime!=''?((row.collectDate?(row.collectDate + ' '):'')+row.collectTime):row.collectDate }}
          </template>
        </template>
      </el-table-column>
      <el-table-column prop="storeTime" label="入库时间" width="160" :key="Math.random()" align="center" />
      <el-table-column prop="assayDate" label="分析时间" min-width="160px" :key="Math.random()" align="center" />
      <el-table-column prop="endDate" label="截止时间" width="120px" :key="Math.random()" align="center" />
      <el-table-column label="操作" width="140px" fixed="right" :key="Math.random()" align="center">
        <template slot-scope="{row}">
          <el-button type="text" @click="handleDetail(row)">查看</el-button>
          <div class="erc-divider-vertical" />
          <el-button type="text" @click="handleApprove(row)"> 审核</el-button>
        </template>
      </el-table-column>
    </el-table>

    <div style="float: right" v-if="tabShow === 2">
      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="searchForm.pageNumber"
        :limit.sync="searchForm.pageSize"
        @pagination="handleSearch"
      />
    </div>

    <!-- 检测详情 -->
    <el-dialog title="检测详情" :visible.sync="detailVisible" width="70%" center top="5vh">
      <div style="width: 800px;margin:0 auto;">
        <el-form label-width="100px" label-position="left">
          <el-form-item label="样品编号:">{{ sampleForm.sampleNo }}</el-form-item>
          <el-form-item label="检测因子:">{{ sampleForm.factorName }}</el-form-item>
          <el-form-item label="检测标准:">{{ sampleForm.standardNo }}&nbsp;&nbsp;{{ sampleForm.standardName }}</el-form-item>
          <el-form-item label="因子备注:">{{ sampleForm.factorRemark }}</el-form-item>
          <el-form-item label="检测备注:">{{ sampleForm.remark }}</el-form-item>
          <el-form-item label="检测结果:">
            <template v-if="sampleForm.factorSubsetVos && sampleForm.factorSubsetVos.length >0">
              <el-table
                :data="sampleForm.factorSubsetVos"
                border
                style="width:100%;"
                :header-cell-style="{background:'#ECF3FC'}"
              >
                <el-table-column prop="factorName" label="套餐因子" align="center" />
                <el-table-column prop="name" label="检测结果" align="center">
                  <template slot-scope="{row}">
                    {{ row.factorName }}: {{ row.factorInfo&&row.factorInfo.v1?row.factorInfo.v1:0 }}
                    <template v-if="row.factorInfo&&row.factorInfo.v2!==''&&row.factorInfo.v2!==0">
                      ×10<sup>{{ row.factorInfo.v2?Number(row.factorInfo.v2):0 }}</sup>
                    </template>
                    {{ row.unitName && row.unitName!=='无量纲'&& sampleForm.unitName!=null?' ' + row.unitName:'' }}
                  </template>
                </el-table-column>
              </el-table>
            </template>
            <template v-else-if="sampleForm.checkRes && sampleForm.checkRes.length > 0">
              {{ sampleForm.factorInfo&&sampleForm.factorInfo.v1?sampleForm.factorInfo.v1:0 }}
              <template v-if="sampleForm.factorInfo&&sampleForm.factorInfo.v2!==''&&sampleForm.factorInfo.v2!==0">
                ×10<sup>{{ sampleForm.factorInfo.v2?Number(sampleForm.factorInfo.v2):0 }}</sup>
              </template>
              {{ sampleForm.unitName && sampleForm.unitName!=='无量纲' && sampleForm.unitName!=null?' ' + sampleForm.unitName:'' }}
            </template>
            <template v-else>暂无检测结果</template>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="detailVisible = false">关 闭</el-button>
      </div>
    </el-dialog>

    <!-- 检测结果审核 -->
    <el-dialog title="检测结果审核" :visible.sync="approveVisible" center>
      <div style="width: 400px;margin:0 auto">
        <el-form :model="approveForm" label-width="100px">
          <el-form-item label="审核结果:">
            <el-radio-group v-model="approveForm.auditFlag">
              <el-radio label="1">通过</el-radio>
              <el-radio label="2">驳回</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="approveForm.auditFlag === '2'" label="审核意见:">
            <el-input v-model="approveForm.auditReason" type="textarea" :rows="3" maxlength="50" show-word-limit placeholder="审核意见" />
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="approveVisible=false">取消</el-button>
        <el-button type="primary" @click="confirmDialog">确认</el-button>
      </div>
    </el-dialog>

    <!-- 批量检测结果审核 -->
    <el-dialog title="检测结果审核" :visible.sync="batchApproveVisible" center>
      <div style="width: 400px;margin:0 auto">
        <el-form :model="batchApproveForm" label-width="100px">
          <el-form-item label="审核结果:">
            <el-radio-group v-model="batchApproveForm.auditFlag">
              <el-radio label="1">通过</el-radio>
              <el-radio label="2">驳回</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="batchApproveForm.auditFlag === '2'" label="审核意见:">
            <el-input v-model="batchApproveForm.auditReason" type="textarea" :rows="3" maxlength="50" show-word-limit placeholder="审核意见" />
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="batchApproveVisible=false">取消</el-button>
        <el-button type="primary" @click="batchConfirmDialog">确认</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import * as checkServer from '@/api/check'
import Pagination from '@/components/Pagination'
const CHECK_STATUS = {
  '0': '待领样',
  '1': '领样申请',
  '2': '待检测',
  '3': '已录入',
  '4': '待审核',
  '5': '审核通过',
  '6': '审核失败'
}
export default {
  components: { Pagination },
  filters: {
    statusQualityFilter(status) {
      if (status === '0' || status === '2') {
        return 'info'
      } else if (status === '1' || status === '3' || status === '4') {
        return ''
      } else if (status === '5') {
        return 'success'
      } else {
        return 'danger'
      }
    }
  },
  data() {
    return {
      CHECK_STATUS,
      checkData: [],
      searchForm: {
        sampleNo: '',
        checkStatus: '4',
        factorName: '',
        pageNumber: 1,
        pageSize: 10
      },
      total: 0,
      detailVisible: false,
      sampleForm: {
        factorInfo: {},
        subFactors: {}
      },
      approveForm: {
        checkFactorId: '',
        auditFlag: '1',
        auditReason: ''
      },
      approveVisible: false,
      subSampleData: [],
      batchApproveVisible: false,
      batchApproveForm: {
        checkFactorId: '',
        auditFlag: '1',
        auditReason: ''
      },
      multipleSelection: [],


      tabShow: 1,
      checkDataTwo: [],
      searchFormTwo: {
        sampleNo: '',
        pageNumber: 1,
        pageSize: 10
      },
      totalTwo: 0,
      multipleSelectionTwo: []

    }
  },
  created() {
    this.handleSearch()
    this.handleSearchTwo()
  },
  methods: {
    handleSearch() {
      checkServer.findCheckFactorByCondition(this.searchForm).then(res => {
        if (res.code === 200) {
          this.checkData = res.result.records.map(i => {
            if (i.checkRes && i.checkRes !== '') {
              const ob = JSON.parse(i.checkRes)
              this.$set(i, 'masterRes', ob.v1 ? ob.v1 : 0)
              this.$set(i, 'exponRes', ob.v2 ? ob.v2 : 0)
            } else {
              this.$set(i, 'masterRes', 0)
              this.$set(i, 'exponRes', 0)
            }
            return i
          }) || []
          this.total = res.result.total
        }
      })
    },

    handleSearchTwo() {
      checkServer.findCheckFactorByConditionTwo(this.searchFormTwo).then(res => {
        if (res.code === 200) {
          this.checkDataTwo = res.result.records.map(i => {
            if (i.checkRes && i.checkRes !== '') {
              const ob = JSON.parse(i.checkRes)
              this.$set(i, 'masterRes', ob.v1 ? ob.v1 : 0)
              this.$set(i, 'exponRes', ob.v2 ? ob.v2 : 0)
            } else {
              this.$set(i, 'masterRes', 0)
              this.$set(i, 'exponRes', 0)
            }
            return i
          }) || []
          this.totalTwo = res.result.total
        }
      })
    },

    factorAudit(row) {
      this.$router.push(`/other/approveFactorList/${row.sampItemId}`)
    },

    handleDetail(row) {
      this.sampleForm = { ...row }
      if (row.factorSubsetVos && row.factorSubsetVos.length > 0) {
        this.sampleForm.factorSubsetVos.forEach(i => {
          const factorInfo = JSON.parse(i.checkSubRes)
          this.$set(i, 'factorInfo', factorInfo)
        })
      }
      if (row.checkRes && row.checkRes.length > 0) {
        const factorInfo = JSON.parse(row.checkRes)
        this.$set(this.sampleForm, 'factorInfo', factorInfo)
      }
      this.detailVisible = true
    },
    handleApprove(row) {
      this.approveForm.checkFactorId = row.checkFactorId
      this.approveForm.auditFlag = '1'
      this.approveForm.auditReason = ''
      this.approveVisible = true
    },
    batchConfirmDialog() {
      this.$confirm('确定提交?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        checkServer.batchAuditCheckFactor(this.batchApproveForm).then(res => {
          if (res.code === 200) {
            this.$notify({
              title: '成功',
              message: res.message,
              type: 'success'
            })
            this.batchApproveVisible = false
            this.handleSearch()
          } else {
            this.$notify({
              title: '失败',
              message: res.message,
              type: 'error'
            })
          }
        })
      }).catch(() => {})
    },
    handleSelectionChange(val) {
      this.multipleSelection = val
    },

    tabChange() {
      this.tabShow = 1;
    },

    tabChangeTwo() {
      this.tabShow = 2;
    },

    handleSelectionChangeTwo(val) {
      this.multipleSelectionTwo = val
    },

    handleBatchApprove() {
      if (this.multipleSelection && this.multipleSelection.length > 0) {
        const checkFactors = this.multipleSelection.map(i => {
          return i.checkFactorId
        })
        debugger
        this.batchApproveForm.checkFactorId = checkFactors.toString()
        this.batchApproveForm.auditFlag = '1'
        this.batchApproveForm.auditReason = ''
        this.batchApproveVisible = true
      } else {
        this.$message.warning('至少选择一条记录进行审核')
      }
    },
    confirmDialog() {
      this.$confirm('确定提交?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        checkServer.auditCheckFactor(this.approveForm).then(res => {
          if (res.code === 200) {
            this.$notify({
              title: '成功',
              message: res.message,
              type: 'success'
            })
            this.approveVisible = false
            this.handleSearch()
          } else {
            this.$notify({
              title: '失败',
              message: res.message,
              type: 'error'
            })
          }
        })
      }).catch(() => {})
    }

  }
}
</script>

<style scoped lang="scss" type="text/scss">
  .search_div {
    >div {
      &:nth-child(1){
        margin-right: 10px;
      }
      display: inline-block;
    }
  }

  .search_input {
    width: 200px;
    margin-bottom: 5px;
  }
  .search-right {
    text-align: right;
    padding-right: 25px;
  }
  .item {
    font-size: 16px;
  }
  ::v-deep .el-card .el-card__header {
    padding: 5px 20px;
    background: #F3F2F2;
  }
  .block-flex {
    position: relative;
    display: flex;
    &>div{
      border: 1px solid #B7B7B7;
      width: 100px;
      margin: 0;
      line-height: 30px;
      text-align: center;
    }
    &>div:first-child {
      background: #B7B7B7;
    }
  }
  .card-left {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
  }
  .card-right {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
  }
  .el-card {
    overflow: auto;
  }
  .el-dropdown-link {
    cursor: pointer;
    color: #409EFF;
  }
  .el-icon-arrow-down {
    font-size: 12px;
  }
  // /deep/.el-table__header-wrapper  .el-checkbox{
  //   display:none
  // }

</style>

<style scoped lang="scss" type="text/scss">
  .search_div {
    >div {
      &:nth-child(1){
        margin-right: 10px;
      }
      display: inline-block;
    }
  }

  .search_input {
    width: 200px;
    margin-bottom: 5px;
  }
  .search-right {
    text-align: right;
    padding-right: 25px;
  }
  .item {
    font-size: 16px;
  }
  ::v-deep .el-card .el-card__header {
    padding: 5px 20px;
    background: #F3F2F2;
  }
</style>

<style scoped lang="scss" type="text/scss">
  .search_div {
    >div {
      &:nth-child(1){
        margin-right: 10px;
      }
      display: inline-block;
    }
  }

  .search_input {
    width: 200px;
    margin-bottom: 5px;
  }
  .search-right {
    text-align: right;
    padding-right: 25px;
  }
  .item {
    font-size: 16px;
  }
  ::v-deep .el-card .el-card__header {
    padding: 5px 20px;
    background: #F3F2F2;
  }
  .block-flex {
    position: relative;
    display: flex;
    &>div{
      border: 1px solid #B7B7B7;
      width: 100px;
      margin: 0;
      line-height: 30px;
      text-align: center;
    }
    &>div:first-child {
      background: #B7B7B7;
    }
  }
  .card-left {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
  }
  .card-right {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
  }
  .el-card {
    overflow: auto;
  }
  .el-dropdown-link {
    cursor: pointer;
    color: #409EFF;
  }
  .el-icon-arrow-down {
    font-size: 12px;
  }
  // /deep/.el-table__header-wrapper  .el-checkbox{
  //   display:none
  // }

</style>
<style scoped>

table {
    background-color: transparent
}

caption {
    padding-top: 8px;
    padding-bottom: 8px;
    color: #777;
    text-align: left
}

th {
    text-align: left
}

.table {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px
}

.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th {
    padding: 8px;
    line-height: 1.42857143;
    vertical-align: middle;
    border-top: 1px solid #ddd
}

.table>thead>tr>th {
    vertical-align: bottom;
    border-bottom: 2px solid #ddd
}

.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th {
    border-left: 1px solid #F1F2F4
}

.table>tbody+tbody {
    border-top: 2px solid #ddd
}

.table .table {
    background-color: #fff
}

.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th {
    padding: 5px
}

.table-bordered {
    border: 1px solid #ddd
}

.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th {
    border: 1px solid #ddd
}

.table-bordered>thead>tr>td,.table-bordered>thead>tr>th {
    border-bottom-width: 2px
}

.table-striped>tbody>tr:nth-of-type(odd) {
    background-color: #f9f9f9
}

.table-hover>tbody>tr:hover {
    background-color: #f5f5f5
}

table col[class*=col-] {
    position: static;
    display: table-column;
    float: none
}

table td[class*=col-],table th[class*=col-] {
    position: static;
    display: table-cell;
    float: none
}

.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active {
    background-color: #f5f5f5
}

.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover {
    background-color: #e8e8e8
}

.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success {
    background-color: #dff0d8
}

.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover {
    background-color: #d0e9c6
}

.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info {
    background-color: #d9edf7
}

.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover {
    background-color: #c4e3f3
}

.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning {
    background-color: #fcf8e3
}

.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover {
    background-color: #faf2cc
}

.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger {
    background-color: #f2dede
}

.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover {
    background-color: #ebcccc
}

.table-responsive {
  min-height: 3.01%;
  overflow-x: auto;
}

.table-bordered, .table-bordered > tbody > tr > td, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > td, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > thead > tr > th {
    border: 1px solid #e9ecef;
    text-align: center;
}

.table-bordered, td, th {
    border-radius: 0 !important;
}

.table-bordered > tbody > tr:last-child > td {
    border-bottom: 1px solid #e9ecef;
}

.bootstrap-table .fixed-table-container .fixed-table-header {
    overflow: hidden;
    background: rgba(0, 0, 0, .05);
}

.fixed-table-header .table > thead > tr {
    background: none !important;
}

.table > thead > tr {
    color: #636363;
    font-weight: 400;
    background: rgba(0, 0, 0, .05);
    /*   background: repeat-x #fafafa;
  background-image: -webkit-linear-gradient(top,#F8F8F8 0,#fafafa 100%);
  background-image: -o-linear-gradient(top,#F8F8F8 0,#fafafa 100%);
  background-image: linear-gradient(to bottom,#F8F8F8 0,#fafafa 100%);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff8f8f8', endColorstr='#ffececec', GradientType=0); */
}

.table > thead > tr > th {
    border-color: #e9ecef;
    font-weight: 700;
    border-right-color: transparent;
}

.table > thead > tr > th .ace-icon:first-child {
    margin-right: 2px;
}

.table > thead > tr > th:first-child {
    border-left-color: #F1F1F1;
}

.table > thead > tr > th:last-child {
    border-right-color: #F1F1F1;
}

.table.table-bordered > thead > tr > th {
    vertical-align: middle;
}

td.center, th.center {
    text-align: center;
}

td .lbl, th .lbl {
    margin-bottom: 0;
}

td .lbl:only-child, th .lbl:only-child {
    vertical-align: top;
}

.table-header {
    background-color: #307ECC;
    color: #FFF;
    font-size: 14px;
    line-height: 30px;
    padding-left: 12px;
    margin-bottom: 1px;
}

.table-header .close {
    margin-right: 8px;
    margin-top: 0;
    opacity: .45;
    filter: alpha(opacity=45);
}

.table-header .close:hover {
    opacity: .75;
    filter: alpha(opacity=75);
}

th.detail-col {
    width: 48px;
    text-align: center;
}

tr.detail-row {
    display: none;
}

tr.detail-row.open {
    display: block;
    display: table-row;
}

tr.detail-row > td {
    background-color: #f1f6f8;
    border-top: 3px solid #d1e1ea !important;
}

.table-detail {
    background-color: #fff;
    border: 1px solid #dcebf7;
    width: 100%;
    padding: 12px;
}
.table-detail td > .profile-user-info {
    width: 100%;
}

.views {
  color: #fff;
  background: rgba(73, 69, 64, 0.65);
  border-color: rgba(73, 69, 64, 0.65);
}
.viewsb {
  color: #fff;
  background: rgba(73, 69, 64, 0.65);
  border-color: rgba(73, 69, 64, 0.65);
}
.views:focus,
.views:hover {
  background: #1890ff;
  border-color: #1890ff;
  color: #fff;
}
.viewsb:focus,
.viewsb:hover {
  background: #1890ff;
  border-color: #1890ff;
  color: #fff;
}

.apostrophe{
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
</style>
